package com.yztc.love_travel.ui.main;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;


import com.yztc.love_travel.R;
import com.yztc.love_travel.ui.login.LoginActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * "我的"
 */
public class MyActivity extends AppCompatActivity {

    @BindView(R.id.toolbar_login)
    Toolbar toolbarLogin;
    @BindView(R.id.imageview_head_login)
    ImageView imageviewHeadLogin;
    @BindView(R.id.layout_login)
    LinearLayout layoutLogin;
    @BindView(R.id.like_my)
    TextView likeMy;
    @BindView(R.id.comment_my)
    TextView commentMy;
    @BindView(R.id.coin_my)
    TextView coinMy;
    @BindView(R.id.textview_shop)
    TextView textviewShop;
    @BindView(R.id.textview_collect)
    TextView textviewCollect;
    @BindView(R.id.textview_order)
    TextView textviewOrder;
    @BindView(R.id.textview_lottery_history)
    TextView textviewLotteryHistory;
    @BindView(R.id.textview_massage)
    TextView textviewMassage;
    @BindView(R.id.textview_help)
    TextView textviewHelp;
    @BindView(R.id.textview_setting)
    TextView textviewSetting;
    @BindView(R.id.activity_login)
    LinearLayout activityLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);
        ButterKnife.bind(this);
        initBar();
    }

    private void initBar() {
        toolbarLogin.setTitle(R.string.my);
        toolbarLogin.setTitleMarginStart(Gravity.CENTER);
        toolbarLogin.setNavigationIcon(R.drawable.ic_back);
        setSupportActionBar(toolbarLogin);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_toolbar,menu);
        return super.onCreateOptionsMenu(menu);
    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if(item.getItemId()==android.R.id.home){
            finish();
        }
        return super.onOptionsItemSelected(item);
    }

    @OnClick({R.id.layout_login, R.id.like_my, R.id.comment_my, R.id.coin_my, R.id.textview_shop, R.id.textview_collect, R.id.textview_order, R.id.textview_lottery_history, R.id.textview_massage, R.id.textview_help, R.id.textview_setting, R.id.activity_login})
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.layout_login:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.like_my:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.comment_my:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.coin_my:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_shop:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_collect:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_order:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_lottery_history:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_massage:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_help:
                intent.setClass(this,LoginActivity.class);
                break;
            case R.id.textview_setting:
                intent.setClass(this,LoginActivity.class);
                break;
        }
        startActivity(intent);
    }
}
